package test.enba.mq.producer.controller.rabbitmq.topic;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TopicExchangeProducer {

  @Autowired private RabbitTemplate rabbitTemplate;

  public void sendMessage(String routingKey, String message) {
    rabbitTemplate.convertAndSend("topic-exchange", routingKey, message);
  }
}
